import request from '@/config/axios'

// 指纹浏览器账号 VO
export interface AccountVO {
  id: number // 主键
  bitId: string // 游览器ID
  accountNo: string // 执行账号
  ownerUser: string // 归属人
  cookie: string // cookie
  proxy: string // 代理信息
  config: string // 操作配置信息
  comment: string // 备注信息
}

// 指纹浏览器账号 API
export const AccountApi = {
  // 查询指纹浏览器账号分页
  getAccountPage: async (params: any) => {
    return await request.get({ url: `/douyin/account/page`, params })
  },

  // 查询指纹浏览器账号详情
  getAccount: async (id: number) => {
    return await request.get({ url: `/douyin/account/get?id=` + id })
  },

  // 新增指纹浏览器账号
  createAccount: async (data: AccountVO) => {
    return await request.post({ url: `/douyin/account/create`, data })
  },

  // 修改指纹浏览器账号
  updateAccount: async (data: AccountVO) => {
    return await request.put({ url: `/douyin/account/update`, data })
  },

  // 删除指纹浏览器账号
  deleteAccount: async (id: number) => {
    return await request.delete({ url: `/douyin/account/delete?id=` + id })
  },

  // 导出指纹浏览器账号 Excel
  exportAccount: async (params) => {
    return await request.download({ url: `/douyin/account/export-excel`, params })
  }
}